package cn.u313.comm.utils;

import cn.u313.comm.conststring.ImgDB;

import static cn.u313.comm.utils.Util.getTime;

public class XmlUtil {
    static String xml="[CQ:service,content=<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><msg servic" +
            "eID=\"108\" templateID=\"1\" action=\"web\" brief=\"你的小嘤被人拐跑啦！\" sourc" +
            "ePublicUin=\"2747277822\" sourceMsgId=\"0\" u" +
            "rl=\"https://youxi.gamecenter.qq.com/\" flag=\"0\" adverSign=\"0\" multi" +
            "MsgFlag=\"0\"><item layout=\"2\" advertiser_id=\"0\" aid=\"0\"><picture c" +
            "over=\"%s\" w" +
            "=\"0\" h=\"0\" /><title>%s</title><summary>%s</summary></item><source name=\"签到成功\" icon=\"https://url.cn/JS" +
            "8oE7\" action=\"plugin\" a_actionData=\"mqqapi://app/action?pkg=com.tencent.mobileqq&amp;amp;cmp=com.tence" +
            "nt.biz.pubaccount.AccountDetail.activity.api.impl.AccountDetailActivity&amp;amp;uin=2747277822\" i_actio" +
            "nData=\"mqqapi://card/show_pslcard?src_type=internal&amp;amp;card_type=public_account&amp;amp;uin=2747277822&amp;amp;v" +
            "ersion=1\" appid=\"-1\" /></msg>,serviceId=108]";
     static  String txt = "[CAT:rich,content=<?xml version&#61;'1.0' encoding&#61;'UTF-8' standalone&#61;'yes' ?><msg serviceID&#61;\"108\" templateID&#61;\"1\" action&#61;\"web\" brief&#61;\"你的小嘤被人拐跑啦！\" sourcePublicUin&#61;\"2747277822\" sourceMsgId&#61;\"0\" url&#61;\"https://youxi.gamecenter.qq.com/\" flag&#61;\"0\" adverSign&#61;\"0\" multiMsgFlag&#61;\"0\"><item layout&#61;\"2\" advertiser_id&#61;\"0\" aid&#61;\"0\"><picture cover&#61;\"%s\" w&#61;\"0\" h&#61;\"0\" /><title>%s</title><summary>%s</summary></item><source name&#61;\"签到成功\" icon&#61;\"https://url.cn/JS8oE7\" action&#61;\"plugin\" a_actionData&#61;\"mqqapi://app/action?pkg&#61;com.tencent.mobileqq&amp;amp;cmp&#61;com.tencent.biz.pubaccount.AccountDetail.activity.api.impl.AccountDetailActivity&amp;amp;uin&#61;2747277822\" i_actionData&#61;\"mqqapi://card/show_pslcard?src_type&#61;internal&amp;amp;card_type&#61;public_account&amp;amp;uin&#61;2747277822&amp;amp;version&#61;1\" appid&#61;\"-1\" /></msg>,serviceId=108]\n";
     static  String txt20220525 = "[CAT:rich,content=<?xml version&#61;'1.0' encoding&#61;'UTF-8' standalone&#61;'yes' ?><msg serviceID&#61;\"108\" templateID&#61;\"1\" action&#61;\"web\" brief&#61;\"你的小嘤被人拐跑啦！\" sourcePublicUin&#61;\"2747277822\" sourceMsgId&#61;\"0\" url&#61;\"https://youxi.gamecenter.qq.com/m/act/\" flag&#61;\"0\" adverSign&#61;\"0\" multiMsgFlag&#61;\"0\"><item layout&#61;\"2\" advertiser_id&#61;\"0\" aid&#61;\"0\"><picture cover&#61;\"%s\" w&#61;\"0\" h&#61;\"0\" /><title>%s</title><summary>%s</summary></item></msg>,serviceId=108]";
    String musicXml="<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><msg serviceID=\"146\" " +
            "templateID=\"1\" action=\"web\" brief=\"&#91;分享&#93; 小嘤唱的\" sourceMsgId=\"0\" " +
            "url=\"https://y.313u.cn/?_wv=1&amp;amp;songmid=001DEjRI0ihriN&amp;amp;source=bgmm&amp;amp;ADTAG=bgmm\" " +
            "flag=\"0\" adverSign=\"0\" multiMsgFlag=\"0\"><item layout=\"2\" advertiser_id=\"0\" " +
            "aid=\"0\"><picture cover=\"https://y.qq.com/music/photo_new/T002R300x300M000000LNpPn0efhTG.jpg?max_age=2592000\" " +
            "w=\"0\" h=\"0\" /><title>踏山河</title><summary>是七叔呢0</summary></item><source name=\"QQ音乐\" " +
            "icon=\"http://i.gtimg.cn/open/app_icon/01/07/98/56//1101079856_100_m.png?date=20201228\" " +
            "url=\"http://web.p.qq.com/qqmpmobile/aio/app.html?id=1101079856\" " +
            "musicUrl=\"http://music.163.com/song/media/outer/url?id=386844\" action=\"app\" " +
            "a_actionData=\"com.tencent.qqmusic\" i_actionData=\"tencent1101079856://\" " +
            "appid=\"1101079856\" /></msg>";
    public static String LiWuBase="[CQ:app,content={\"app\":\"com.tencent.giftmall.giftar" +
            "k\"&#44;\"config\":{\"ctime\":1609401487&#44;\"forward\":0&#44;\"tok" +
            "en\":\"bcc60d12c3f22f15335dd38d313b6c89\"}&#44;\"desc\":\"\"&#44;\"extra\":{\"app_ty" +
            "pe\":1&#44;\"appid\":1103584836&#44;\"uin\":1054980699}&#44;\"meta\":{\"giftData\":{\"ani" +
            "mationType\":\"0\"&#44;\"arkBgUrl\":\"/qzone/space_item/material/QzoneGift/org/15/17743/ke.p" +
            "ng\"&#44;\"arkGuestBgUrl\":\"/qzone/space_item/material/QzoneGift/org/4/207764/ke.png\"&#44;\"b" +
            "oxZipUrl\":\"/qzone/qzact/act/external/shijun/aboxZipUrl.zip\"&#44;\"desc\":\"新年快乐，平安顺" +
            "遂\"&#44;\"giftMsg\":\"新年快乐，平安顺遂~\"&#44;\"giftName\":\"新年开运符\"&#44;\"giftParticle" +
            "Url\":\"/aoi/sola/20201229112733_zOpOfhZBcZ.png\"&#44;\"giftPrice\":\"10\"&#44;\"giftZi" +
            "pUrl\":\"/qzone/qzact/act/external/shijun/xnkyfdh.zip\"&#44;\"inviteDetailUrl\":\"\"&#4" +
            "4;\"isFree\":\"0\"&#44;\"lottieUrl\":\"\"&#44;\"msgId\":\"#msgId#\"&#44;\"openIconUrl\":\"/a" +
            "oi/sola/20201229112733_cuiW2yzVYc.png\"&#44;\"orderNum\":\"31e2e30c-ba8b-4c2d-b1d2-53ec718bc" +
            "5aa\"&#44;\"sender\":\"#sender#\"&#44;\"toUin\":\"1054980699\"&#44;\"total_amount\":\"0\"&#44;\"u" +
            "nopenIconUrl\":\"/aoi/sola/20190402111555_yWazmedH08.png\"}}&#44;\"prom" +
            "pt\":\"&#91;礼物&#93;送你一份小惊喜\"&#44;\"ver\":\"1.0.4.3\"&#44;\"view\":\"gift" +
            "Ark\"}]";
    public static String LiWu="[CQ:app,content={\"app\":\"com.tencent.giftmall.giftar" +
            "k\"&#44;\"config\":{\"ctime\":1609401487&#44;\"forward\":0&#44;\"tok" +
            "en\":\"bcc60d12c3f22f15335dd38d313b6c89\"}&#44;\"desc\":\"\"&#44;\"extra\":{\"app_ty" +
            "pe\":1&#44;\"appid\":1103584836&#44;\"uin\":1054980699}&#44;\"meta\":{\"giftData\":{\"ani" +
            "mationType\":\"0\"&#44;\"arkBgUrl\":\"/qzone/space_item/material/QzoneGift/org/15/17743/ke.p" +
            "ng\"&#44;\"arkGuestBgUrl\":\"/qzone/space_item/material/QzoneGift/org/4/207764/ke.png\"&#44;\"b" +
            "oxZipUrl\":\"/qzone/qzact/act/external/shijun/aboxZipUrl.zip\"&#44;\"desc\":\"新年快乐，平安顺" +
            "遂 \"&#44;\"giftMsg\":\"新年快乐，平安顺遂~%s\"&#44;\"giftName\":\"新年开运符\"&#44;\"giftParticle" +
            "Url\":\"/aoi/sola/20201229112733_zOpOfhZBcZ.png\"&#44;\"giftPrice\":\"0\"&#44;\"giftZi" +
            "pUrl\":\"%s\"&#44;\"inviteDetailUrl\":\"\"&#4" +
            "4;\"isFree\":\"1\"&#44;\"lottieUrl\":\"\"&#44;\"msgId\":\"#msgId#\"&#44;\"openIconUrl\":\"/a" +
            "oi/sola/20201229112733_cuiW2yzVYc.png\"&#44;\"orderNum\":\"31e2e30c-ba8b-4c2d-b1d2-53ec718bc" +
            "5aa\"&#44;\"sender\":\"#sender#\"&#44;\"toUin\":\"1054980699\"&#44;\"total_amount\":\"0\"&#44;\"u" +
            "nopenIconUrl\":\"/aoi/sola/20190402111555_yWazmedH08.png\"}}&#44;\"prom" +
            "pt\":\"&#91;新年快乐!&#93;%s\"&#44;\"ver\":\"1.0.4.3\"&#44;\"view\":\"gift" +
            "Ark\"}]";
    static String[] dh={
            "/qzone/qzact/act/external/shijun/nnnqctdh.zip",
            "/qzone/qzact/act/external/shijun/NNJLFS.zip",
            "/qzone/qzact/act/external/shijun/xnkyfdh.zip",
            "/qzone/qzact/act/external/shijun/CYGJDG.zip"
//            "/qzone/space_item/material/QzoneGift/org/10/207850/zhenaichaopaolottie.zip"
    };
    public static String LiWu_back="[CQ:app,content={\"app\":\"com.tencent.giftmall.giftar" +
            "k\"&#44;\"config\":{\"ctime\":1609401487&#44;\"forward\":0&#44;\"tok" +
            "en\":\"bcc60d12c3f22f15335dd38d313b6c89\"}&#44;\"desc\":\"\"&#44;\"extra\":{\"app_ty" +
            "pe\":1&#44;\"appid\":1103584836&#44;\"uin\":1054980699}&#44;\"meta\":{\"giftData\":{\"ani" +
            "mationType\":\"0\"&#44;\"arkBgUrl\":\"/qzone/space_item/material/QzoneGift/org/15/17743/ke.p" +
            "ng\"&#44;\"arkGuestBgUrl\":\"/qzone/space_item/material/QzoneGift/org/4/207764/ke.png\"&#44;\"b" +
            "oxZipUrl\":\"/qzone/qzact/act/external/shijun/aboxZipUrl.zip\"&#44;\"desc\":\"新年快乐，平安顺" +
            "遂 \"&#44;\"giftMsg\":\"新年快乐，平安顺遂~%s\"&#44;\"giftName\":\"新年开运符\"&#44;\"giftParticle" +
            "Url\":\"/aoi/sola/20201229112733_zOpOfhZBcZ.png\"&#44;\"giftPrice\":\"0\"&#44;\"giftZi" +
            "pUrl\":\"/qzone/qzact/act/external/shijun/xnkyfdh.zip\"&#44;\"inviteDetailUrl\":\"\"&#4" +
            "4;\"isFree\":\"1\"&#44;\"lottieUrl\":\"\"&#44;\"msgId\":\"#msgId#\"&#44;\"openIconUrl\":\"/a" +
            "oi/sola/20201229112733_cuiW2yzVYc.png\"&#44;\"orderNum\":\"31e2e30c-ba8b-4c2d-b1d2-53ec718bc" +
            "5aa\"&#44;\"sender\":\"#sender#\"&#44;\"toUin\":\"1054980699\"&#44;\"total_amount\":\"0\"&#44;\"u" +
            "nopenIconUrl\":\"/aoi/sola/20190402111555_yWazmedH08.png\"}}&#44;\"prom" +
            "pt\":\"&#91;新年快乐!&#93;%s\"&#44;\"ver\":\"1.0.4.3\"&#44;\"view\":\"gift" +
            "Ark\"}]";
    public static String getXml(String title,String text){
        if (getTime(0) ==20220401){
            return "恭喜你签到失败\n获得 -99 悦币！";
        }
        return title + "\n" + text;
//        if (title.length()>3){
//            return text;
//        }
        //https://qzonestyle.gtimg.cn/qzone/qzact/act/external/shijun/xnkyfdh.zip
        ///https://qzs.qzone.qq.com//qzone/qzact/act/external/shijun/xnkyfdh.zip
//        if(Util.is年初())
//            return String.format(LiWu,new String[]{text,getR(),title});
//        return String.format(txt20220525,new String[]{ImgDB.background[(int)(ImgDB.background.length*Math.random())],title,text});
    }
    private static String getR(){
        String a=dh[(int)(dh.length*Math.random())];
        System.err.println(a);
        return a;
    }
    public static String test(String text,String title){
        return String.format(LiWu,new String[]{text,getR(),title});
    }
    public static String getMusicXml(String song,String sigger,String img,String key){
        String url="";
        return toXml(String.format(xml,new String[]{

        }),146);
    }
    public static String toXml(String xml,int id){

        return "[CAT:rich,content="+xml+",serviceId="+id+"]";
    }


    public static String test010="[CQ:service,content=<?xml version='1.0' encoding='UTF-8' sta" +
            "ndalone='yes' ?><msg serviceID=\"108\" templateID=\"1\" action=\"web\" bri" +
            "ef=\"&#91;分享&#93; 帮帮忙，点一点\" sourcePublicUin=\"2747277822\" sourceMsg" +
            "Id=\"0\" url=\"https://youxi.313.com/m/act/c73139d222e9885d_10007525.html?_wv=" +
            "1&amp;amp;_wwv=&amp;amp;invite_uin=YGxl0q6Kygt9IXRYxG5oKg%3D%3D&amp;amp;adtag=hd10007524\" flag=\"0\" adv" +
            "erSign=\"0\" multiMsgFlag=\"0\"><item layout=\"2\" advertiser_id=\"0\" aid=\"0\"><p" +
            "icture cover=\"https://qgsk.yximg.cn/box/10007524/1610720262_81.jpg\" w=\"0\" h=\"0\" /><ti" +
            "tle>帮帮忙，点一点</title><summary>保底6Q币&#44;你也可以抢!</summary></item><source name=\"QQ" +
            "手游\" icon=\"https://url.cn/JS8oE7\" action=\"plugin\" a_actionData=\"mqqapi://app/acti" +
            "on?pkg=com.tencent.mobileqq&amp;amp;cmp=com.tencent.biz.pubaccount.AccountDetailActivity&am" +
            "p;amp;uin=2747277822\" i_actionData=\"mqqapi://card/show_pslcard?src_type=internal&amp;amp;c" +
            "ard_type=public_account&amp;amp;uin=2747277822&amp;amp;version=1\" appid=\"-1\" /></msg>,serviceId=108]";
}
